package demo.api.trustsign;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

import util.HttpClientUtil;

/**
 * 4.14	意愿短信发送
 * 短信验证码验证场景使用
 * @throws IOException
 */
public class SceneSmsSend {
	private static String appKey = "cAwut4VATycNMq17NZeFUD63pe83l2OJ";
    private static String appSecrty = "3BAlrfr7lW8kwlCMfo1dXS8Syn5q5qjS";
    private static String baseUrl = "http://smp-test.szitrus.com.cn/smp-api";
    private static String api = "/api/trustsign/scene/sms/send";

	public static void main(String[] args) throws IOException {
		String url = baseUrl.concat(api);
		Map<String, String> params = new HashMap<>();

		params.put("user_id", "2");
        params.put("mobile", "18812345678");
        params.put("doc_numbers", "[\"TW-GXHT-20200520A00001\"]");
        params.put("message_content", "【天威诚信】您的验证码为：${code}，请勿泄漏。");
        params.put("expire_time", "120");//秒
        params.put("url", "http://tianwei.com");
        
	    String resStr =  HttpClientUtil.getResponse(url, params, appKey, appSecrty);
	    JSONObject resJson = JSON.parseObject(resStr);	
	    System.out.println(resJson);
	}
}
